package com.lifan.pan.openapi.controller;

import com.lifan.pan.openapi.entity.OpenApi;
import com.lifan.pan.openapi.service.OpenApiService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Controller
public class OpenApiController {
    @PostMapping("/api/getAccessToken")
    public String GetAccessToken(@RequestBody OpenApi openApi) {
        OpenApiService service = new OpenApiService();
        return service.GetAccessToken(openApi.getClientID(), openApi.getClientSecret());
    }
}
